//
//  MineStackView.swift
//  casdon_swiftUI
//
//  Created by ww on 2025/4/15.
//

import SwiftUI
import FlowStacks

enum MineStack: Hashable {
    case mine
    case exploreRecord
    case serviceCenter
    case mineSetting
    case accountAndSafe
    case message
}

struct MineStackView: View {
    @State private var routes: [Route<MineStack>] = []
    var body: some View {
        FlowStack($routes, withNavigation: true) {
            MineView()
                .flowDestination(for: MineStack.self, destination: { stack in
                    switch stack {
                    case .mine:
                        MineView().navigationBarHidden(true).enableSwipeBackGesture(enable: true)
                    case .exploreRecord:
                        ExploreRecordView().navigationBarHidden(true).enableSwipeBackGesture(enable: true)
                    case .serviceCenter:
                        ServiceCenterView().navigationBarHidden(true).enableSwipeBackGesture(enable: true)
                    case .mineSetting:
                        MineSettingView().navigationBarHidden(true).enableSwipeBackGesture(enable: true)
                    case .message:
                        MineMessageView().navigationBarHidden(true).enableSwipeBackGesture(enable: true)
                    case .accountAndSafe:
                        MineAccountAndSafeView().navigationBarHidden(true).enableSwipeBackGesture(enable: true)
                    }
                })
        }
    }
}
